package Model;

/**
 * this class is used for any Being to know what action to do in which
 * direction, used in DecisionMatrix
 */
public class Action {
    // ATTRIBUTES

    private DirectDirection directDirection;
    // i = 0 -> ESCAPE
    // i = 1 -> MOVE POI
    // i = 2 -> DoAction
    // i = 3 -> MoveTarget
    private int decision;

    // CONSTRUCTOR
    public Action() {
    }

    public Action(DirectDirection dd, int decision) {
        this.directDirection = dd;
        this.decision = decision;
    }

    // OWN FUNCTION
    public void displayInTerminal() {
        switch (decision) {
            case 0:
                System.out.print("Escape From");
                break;
            case 1:
                System.out.print("MovePOI in");
                break;
            case 2:
                System.out.print("Do Action in");
                break;
            case 3:
                System.out.print("Move to Target via");
                break;
            default:
                // should never reach
                System.out.println("error in Decision Number");
                break;
        }

        switch (directDirection) {
            case North:
                System.out.println(" North.");
                break;
            case NorthEast:
                System.out.println(" NorthEast.");
                break;
            case East:
                System.out.println(" East");
                break;
            case SouthEast:
                System.out.println(" SouthEast");
                break;
            case South:
                System.out.println(" South");
                break;
            case SouthWest:
                System.out.println(" SouthWest");
                break;
            case West:
                System.out.println(" West");
                break;
            case NorthWest:
                System.out.println(" NorthWest");
                break;
            case None:
                System.out.println(" None");
                break;
            default:
                // should never reach
                System.out.println("error in direction DecisionMatrix. Value : " + directDirection.name() + "--in Action.displayInTerminal");
                break;
        }
    }

    // GETTER - SETTER
    public DirectDirection getDirectDirection() {
        return directDirection;
    }

    public void setDirectDirection(DirectDirection directDirection) {
        this.directDirection = directDirection;
    }

    public int getDecision() {
        return decision;
    }

    public void setDecision(int decision) {
        this.decision = decision;
    }
}
